<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 
    <h:head></h:head> 
   
  <body> 
      
     
   <p:layout fullPage="true">  
        
    <p:layoutUnit position="north" size="120" style =" text-align : center;"  > 
    		<style type="text/css">
        	.ui-widget{font-size:90% !important;}  
      		</style> 
      		<a href="http://localhost:8080/TravelDreamFelConRusWeb/index.xhtml">
         <p:graphicImage  value="logo.jpg" style=" height:100px;" />
         </a>
		</p:layoutUnit>  
		
     <p:layoutUnit position="west" size="200" header="Pagine utili" resizable="false" closable="false" collapsible="false">   
            <p:menu>  
               
           <p:menuitem value="Pacchetti" url="http://localhost:8080/TravelDreamFelConRusWeb/allPackages.xhtml" />  
                 <p:menuitem value="Promozioni" url="http://localhost:8080/TravelDreamFelConRusWeb/promotions.xhtml" />                    
  
            </p:menu>  
        </p:layoutUnit>  
      
     	
     <p:layoutUnit position="east" size="550" header="Pacchetto: #{packageEdit.currentTravelPackage.name}" resizable="false" closable="false" collapsible="false" >  
             <h:form id="form">
		
         <p:dataTable var="stage" value="#{packageEdit.stageModel}" rowKey="#{stage.idStage}" paginator="true" rows="10"  
                selection="#{packageEdit.selectedStage}" selectionMode="single" 
               id="hoteltable"
                 rowsPerPageTemplate="10,15,50">  
                 
     <p:ajax event="rowSelect"  listener= "#{packageEdit.updateCurrentStage}"/>  
  

  
                <f:facet name="header">
                    Tappe del viaggio
                </f:facet>  
                
              
        		<p:column  headerText="Area" sortBy="#{stage.area}"  id="stage_area">
                 #{stage.area}  
        		</p:column> 
        		<p:column  headerText="Data inizio" sortBy="#{stage.timeStart}"  id="stage_timeStart">
                 #{stage.timeStart}  
        		</p:column> 
        		<p:column  headerText="Data fine" sortBy="#{stage.area}"  id="stage_timeEnd">
                 #{stage.timeStart}  
        		</p:column> 
        		
                	
               
               <f:facet name="footer">
                  <p:commandButton  action="#{stageManagement.show()}" value="Visualizza tappa" icon="ui-icon-zoomin" />  
             </f:facet>
				
              </p:dataTable>
         
         </h:form> 
          
           
        </p:layoutUnit>  
      
      <p:layoutUnit position="center">  
	    	 
	   		
        <h:form id="packageForm" styleClass="input-form">
        
		<p:panel header="Informazioni sul pacchetto" id="panel">
		       
         
		<p:messages id="messages" showDetail="true" showSummary="false" autoUpdate="true"/>

	<h:panelGrid columns="2">
	
		<p:outputLabel value="Descrizione:" for="description" />
		<h:outputText id="description" label="description"
			value="#{packageEdit.currentTravelPackage.description}"/>  
				
		
		<p:outputLabel value="Data di partenza:" for="startDate" />
		<h:outputText id="startDate" value="#{packageEdit.currentTravelPackage.time_start}" 
			/>
			
		<p:outputLabel value="Data di fine:" for="endDate" />
		<h:outputText id="endDate" value="#{packageEdit.currentTravelPackage.time_end}" />
			
		 <p:commandButton  action="allPackages" value="Ritorna all'elenco" icon="ui-icon-arrowrefresh-1-w" />  
		
	</h:panelGrid>
	
		</p:panel>

	</h:form>			
	 
 
        
	 
	  
        
        </p:layoutUnit>  
      
        </p:layout>  
        
        <h:inputHidden  value="#{packageEdit.update()}"/>
		
        
    </body> 
    
    
</html>